import React from 'react'
import { Uploader } from 'react-vant'
import {getUploader} from '../../../../api/uploader';
import "./index.css"
export default function index() {
  const uploadFile = (file)=>{
      console.log("文件上传");
      const formdata = new FormData()
      formdata.append("username",'asdkkk123')
      formdata.append("pass",'123456')
      formdata.append("file",file)
      console.log(file);
      getUploader(formdata).then((res)=>{return res}).catch(()=>{})
      return {url:""}
  }
//   const demoData = (res)=>{
//     console.log(res);
// }
  return (
    <div>
        <Uploader
          // defaultValue={demoData} 
          upload={uploadFile}
        ></Uploader>
    </div>
  )
}
